<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
   <canvas id="canvas" width="500" height="500" style="background:#000;">
       your browser not support canvas
   </canvas>
   <script src="../js/utils.js"></script>
   <script src="../js/ball.js"></script>
   <script>
       window.onload = function(){
           var canvas = document.getElementById('canvas');
           var context = canvas.getContext('2d');
           
           var ball = new Ball(20, "red");
           ball.x = canvas.width/2
           ball.y = canvas.height/2 - 200;
           
           
           
           var vy = 0.1, ay = 0.01, gravity = 0.2;
           
           (function drawFramw(){
              window.requestAnimationFrame(drawFramw, canvas);
              context.clearRect(0, 0, canvas.width, canvas.height);
               
              //vy += ay;
              vy += gravity;
              ball.y += vy;
               
               checkGround(ball);
              ball.draw(context);
               
           }());
           
   }
    
    
    </script>
    
</body>
</html>